Mapping to <Equivalent> in Output Schema

Hi

I have a output schema which includes a <Equivalent> element with several possible options, e.g.

        <Product>

    <Equivalent>

<Desktops>

<Laptops>

etc.

The XSD looks like this

  <xs:element name="VendorCatalog">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element ref="tns:Product" />
        etc .....

<xs:element block="substitution" name="Product" type="tns:VendorProduct">
etc .....

  <xs:complexType name="VendorProduct" abstract="true">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="PriceInformation">
        <xs:complexType>
  etc .....

  <xs:complexType name="Laptops">


    <xs:annotation>
      <xs:documentation>Laptops</xs:documentation>
    </xs:annotation>
    <xs:complexContent mixed="false">
      <xs:extension base="VendorProduct">
        <xs:sequence>

1. I need to generate XML which starts like this with a xsi:type dependant on a value in the imput XML.

 <Product xsi:type="Laptops" ProductCode="PROD123456">
  <PriceInformation>
   <Price Currency="GBP" UnitOfMeasure="Quantity" Value="9.99"/>
  </PriceInformation>

If I deceide that I want to generate a "Laptop",  using the BizTalk Mapper - how do I assign a value to Product xsi:type ??

2. The structure Laptops has extension base="VendorProduct"  

If I deceide that I want to generate a "Laptop" and I want to generate a field in the VendorProduct structure (eg price), do link to the field Price in the VendorProduct data structure or the Price field in the Laptops data structure?

Or is there an Idiot's guide to mapping to <Equivalent>

Thanks

February 9th, 2015 10:33am

do you have more explanation about this issue?
Free Windows Admin Tool Kit Click here and download it now
February 12th, 2015 2:53am

If your schema contains information like..

<xs:element name="VendorCatalog">
    <xs:complexType>
      <xs:sequence maxOccurs="unbounded">
        <xs:element ref="tns:Product" />

and..
<xs:complexType name="VendorProduct" abstract="true">
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="1" name="PriceInformation">
        <xs:complexType>

if you want to map the "xsi:type" attribute with name of the node/element like..

<Product xsi:type="Laptops" ProductCode="PROD123456">

rather than the mapped node/element's value, then change the link's "Soruce Links" property value from its defualt "Copy text value" to "Copy name". So link the Laptop element from the soruce to the xsi:type attribute to the destination schema using a standard link. Then select the link, go to its property and change the above mentioned property.

February 12th, 2015 4:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics